Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

299
Visualizações
Problem with "Personal_Sign" in ethereum.request - "Invalid parameters: must provide an Ethereum address."

I am getting a problem when I run this statement in the console window (from browser) to get signature of the account:

ethereum.request({ method: "personal_sign", params: [account, hash] });

I did not used to have this problem, it works fine and returns a promise with the digital signature of the account (from Metamask). It would open up Metamask, I would do a digital signing and return the result of the digital signature to the promise.

Now it reports an error whenever I run the statement. The error message is:

code: -32602 message: "Invalid parameters: must provide an Ethereum address."

Has something changed? I could not find any other details from ethereum.org or Metamask. If anyone has some knowledge on this, what seems to be the problem?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

First element of params ("account") have to be one of the connected accounts.

You can access accounts with;

window.ethereum
  .request({ method: "eth_requestAccounts" })
  .then(accounts => {
    console.log(accounts);
  })
about 4 years ago · Juan Pablo Isaza Relatório

0

This has to do with MetaMask and the Ethereum window object in the browser.

Originally I tested the contract on a testnet using an injected Web3 provider.

When I was trying to test locally I used one of the JVM generated accounts.

You should not use them. Instead use a MetaMask account (copy the address) and do the ff:

assign the address to a variable (do the same with the hash):

account = Metamask address, hash = bytes32 value of your hashed message

I can then issue the ethereum.request command that will run the "personal_sign" method with the parameters of account and hash.

The promise will return the digital signature of the account when signing a message.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda